(function(){"use strict";BX.namespace("BX.Landing.UI.Field");var i=BX.Landing.Utils.addClass;var t=BX.Landing.Utils.removeClass;var n=BX.Landing.Utils.isPlainObject;var e=BX.Landing.Utils.append;var a=BX.Landing.Utils.findParent;var s=BX.Landing.Utils.offsetLeft;var l=BX.Landing.Utils.offsetTop;var o=BX.Landing.Utils.rect;var r=BX.Landing.Utils.onCustomEvent;var p=BX.Landing.Utils.bind;BX.Landing.UI.Field.Filter=function(t){BX.Landing.UI.Field.BaseField.apply(this,arguments);i(this.layout,"landing-ui-field-filter");this.input.innerHTML=t.html;requestAnimationFrame(function(){BX.ajax.processScripts(BX.processHTML(t.html).SCRIPT,undefined,function(){this.filter=BX.Main.filterManager.getById(t.filterId);this.value=n(t.value)?t.value:{};e(this.filter.getPopup().popupContainer,a(this.layout,{className:"landing-ui-panel-content-body"}));r(this.filter.getPopup(),"onPopupShow",this.adjustPopupPosition.bind(this));p(a(this.layout,{className:"landing-ui-panel-content-body-content"}),"scroll",this.adjustPopupPosition.bind(this));this.filter.getApi().setFields(this.value);this.filter.getApi().apply()}.bind(this))}.bind(this))};BX.Landing.UI.Field.Filter.prototype={constructor:BX.Landing.UI.Field.Filter,__proto__:BX.Landing.UI.Field.BaseField.prototype,getValue:function(){var i=this.filter.getFilterFieldsValues();if(n(i)){if("FIND"in i){delete i["FIND"]}return i}return{}},adjustPopupPosition:function(){if(this.filter.getPopup()){var i=this.input.getBoundingClientRect();var t=6;requestAnimationFrame(function(){this.filter.getPopup().popupContainer.style.top=i.top+i.height+t+"px";this.filter.getPopup().popupContainer.style.left=i.left+"px"}.bind(this))}}}})();